2 Begin VB.Form Principal
\r
3 AutoRedraw = -1 'True
\r
11 StartUpPosition = 3 'Windows Default
\r
12 Begin VB.TextBox txtSalido
\r
16 MultiLine = -1 'True
\r
17 ScrollBars = 2 'Vertical
\r
22 Begin VB.TextBox txtResultado
\r
26 MultiLine = -1 'True
\r
27 ScrollBars = 2 'Vertical
\r
32 Begin VB.TextBox txtAnalizar
\r
36 Text = "La dirección va acá"
\r
40 Begin VB.CommandButton cmdAnalizar
\r
41 Caption = "Analizar"
\r
50 Attribute VB_Name = "Principal"
\r
51 Attribute VB_GlobalNameSpace = False
\r
52 Attribute VB_Creatable = False
\r
53 Attribute VB_PredeclaredId = True
\r
54 Attribute VB_Exposed = False
\r
57 Private Sub cmdAnalizar_Click()
\r
59 On Error GoTo cmdAnalizar_Click_Err
\r
65 Dim iMaxForm As Integer
\r
66 Dim iMaxFra As Integer
\r
67 Dim iMaxCon As Integer
\r
68 Dim Buffer As String
\r
70 On Error Resume Next
\r
71 100 Set ie = CreateObject("InternetExplorer.Application")
\r
72 101 Print2 "Iniciando analisis...", True
\r
73 102 Print2 "0 indica la presencia del primer elemento, -1 que no existen"
\r
76 104 .navigate txtAnalizar.Text
\r
82 107 Do While .ReadyState <> 4
\r
87 110 iMaxFra = .Document.frames.Length - 1
\r
88 111 Print2 "Página: " & txtAnalizar.Text
\r
89 112 Print2 "Número de cuadros: " & iMaxFra
\r
91 113 If iMaxFra <> -1 Then
\r
92 114 Print2 "!!!=> Existen cuadros, se inicia el analisis por cuadro"
\r
94 115 For i = 0 To iMaxFra
\r
95 116 Print2 "-Nombre de cuadro " & i & ": " & .Document.frames(i).Name
\r
96 117 iMaxForm = .Document.frames(i).Document.Forms.Length - 1
\r
97 118 Print2 "--No. formularios en cuadro " & i & ": " & iMaxForm
\r
99 119 For a = 0 To iMaxForm
\r
100 120 iMaxCon = .Document.frames(i).Document.Forms(a).Length - 1
\r
101 121 Print2 "---No. controles en formulario" & a & " de cuadro " & i & ":" & iMaxCon
\r
103 122 For e = 0 To iMaxCon
\r
104 123 Print2 "----Control " & i & "," & a & "," & e & " : " & .Document.frames(i).Document.Forms(a)(e).Value & " :: " & .Document.frames(i).Document.Forms(a)(e).Name
\r
110 124 Print2 "!!!=> No hay cuadros, analisis simple iniciado"
\r
111 125 iMaxForm = .Document.Forms.Length - 1
\r
112 126 Print2 "-Numero de formularios: " & iMaxForm
\r
114 127 If iMaxForm <> -1 Then
\r
116 128 For a = 0 To iMaxForm
\r
117 129 iMaxCon = .Document.Forms(a).Length - 1
\r
118 130 Print2 "--No. controles en formulario: " & a
\r
120 131 For e = 0 To iMaxCon
\r
121 132 Print2 "---Control " & a & "," & e & " : " & .Document.Forms(a)(e).Value & " :: " & .Document.Forms(a)(e).Name
\r
126 133 Print2 "!!-> La pagina no tenía formularios"
\r
130 134 Print2 "Fin de analisis", True
\r
131 135 txtSalido.Text = .Document.documentelement.outerhtml
\r
133 137 Set ie = Nothing
\r
138 cmdAnalizar_Click_Err:
\r
139 controlar_error Erl, Err.Description, "Analizador_Web.Principal.cmdAnalizar_Click.Ref 4/12/2008 : 22:37:33"
\r
144 Private Sub Print2(Texto As String, _
\r
145 Optional Vaciar As Boolean)
\r
147 On Error GoTo Print2_Err
\r
149 Static Buffer As String
\r
151 100 Buffer = Buffer & Texto & vbNewLine
\r
154 txtResultado.Text = Buffer
\r
155 Buffer = vbNullString
\r
163 controlar_error Erl, Err.Description, "Analizador_Web.Principal.Print2"
\r
168 Public Sub controlar_error(algo, algo2, algo3)
\r
172 Private Sub Form_Load()
\r
173 Caption = "Analizador Web V." & App.Major & "." & App.Minor & " para SVCommunty.org & TodoSV.com"
\r